#define _CRT_SECURE_NO_WARNINGS 1
#include<string>
#include<iostream>
#include<list>
using namespace std;
#include"vector.h"

namespace sxn
{
	void test1()
	{
		/*vector<string> i(20,"123456");
		i.push_back("123");*/

		vector<int> i1(10,1);
		vector<int> i2(10,2);
		//i.push_back(2); 
		//i.push_back(2); 
		//i.push_back(2); 
		//i.push_back(2); 
		//i.push_back(2); 
		//i.push_back(3);
		////i.pop_back();
		//i.resize(20,5);
		for (auto str : i1)
		{
			cout << str << " ";
		}
		cout << endl;
		for (auto str : i2)
		{
			cout << str << " ";
		}
		cout << endl;

		swap(i1, i2);

		for (auto str : i1)
		{
			cout << str << " ";
		}
		cout << endl;
		for (auto str : i2)
		{
			cout << str << " ";
		}
		cout << endl;
	}

	void test2()
	{
		vector<int> i1(10, 1);
		vector<int> i2(i1);
		for (auto str : i1)
		{
			cout << str << " ";
		}
		cout << endl;
		for (auto str : i2)
		{
			cout << str << " ";
		}
		cout << endl;
	}
	void test3()
	{
		list<int> l(10, 1);
		vector<int> i(l.begin(), l.end());
		for (auto str : i)
		{
			cout << str << " ";
		}
		cout << endl;

		vector<int>::iterator it =i.erase(i.begin()+5);
		for (auto str : i)
		{
			cout << str << " ";
		}
		cout << endl;

		i.insert(it,5);

		for (auto str : i)
		{
			cout << str << " ";
		}
	}
}

int main()
{
	sxn::test3();
	return 0;
}